package tech.aistar.prj.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tech.aistar.prj.entity.Cust;
import tech.aistar.prj.entity.CustExample;

import java.util.List;

public interface CustMapper {
    int countByExample(CustExample example);

    int deleteByExample(CustExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Cust record);

    int insertSelective(Cust record);

    List<Cust> selectByExample(CustExample example);

    Cust selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Cust record, @Param("example") CustExample example);

    int updateByExample(@Param("record") Cust record, @Param("example") CustExample example);

    int updateByPrimaryKeySelective(Cust record);

    int updateByPrimaryKey(Cust record);

    @Select("SELECT * FROM cust")
    List<Cust> findAll();

    @Delete("delete from cust where id=#{value}")
    int del(Integer id);

    @Update("update cust set cname=#{cname},cpassword=#{cpassword},cstatus=#{cstatus} where id=#{id}")
    int updateByCust(Cust cust);

    List<Cust> searchCont(@Param("cname") String cname, @Param("status") Integer status);
}